//请将如下数组使用原型方法排序
//var arr=[1,5,13,17,22,15,8,6]

Array.prototype.fall = function () {
    for (let i = 0; i < this.length - 1; i++) {
        for (let j = 0; j < this.length - i - 1; j++) {
            if (this[j] < this[j + 1]) {
                let t = this[j]
                this[j] = this[j + 1]
                this[j + 1] = t
            }
        }
    }
    return this
}
Array.prototype.up = function () {
    for (let i = 0; i < this.length - 1; i++) {
        for (let j = 0; j < this.length - i - 1; j++) {
            if (this[j] > this[j + 1]) {
                let t = this[j]
                this[j] = this[j + 1]
                this[j + 1] = t
            }
        }
    }
    return this
}

let s = [1, 5, 13, 17, 22, 15, 8, 6]
console.log(s.fall());
console.log(s.up());